package com.kurumi.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.kurumi.pojo.upload.MedicalResource;
import com.kurumi.pojo.upload.MedicalResourcePic;
import com.kurumi.pojo.upload.ScanFile;
import com.kurumi.pojo.upload.UploadScan;
import com.kurumi.pojo.upload.UploadScanFile;
import com.kurumi.query.MedicalRecordQuery;
import com.kurumi.query.MedicalRecordScanQuery;
import com.kurumi.query.UploadScanQuery;

public interface MedicalRecordScanMapper {

	/**
	 * 获取扫描病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfScan(MedicalRecordScanQuery query);
	
	/**
	 * 获取扫描病案数量
	 * @return
	 */
	int getMedicalRecordCountOfScan(MedicalRecordScanQuery query);

	/**
	 * 获取扫描纸质扫描病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordOfScanSend(MedicalRecordQuery medicalRecordQuery);
	
	/**
	 * 获取扫描纸质扫描病案数量
	 * @return
	 */
	int getMedicalRecordCountOfScanSend(MedicalRecordQuery medicalRecordQuery);
	
	/**
	 * 获取扫描纸质扫描病案
	 * @return
	 */
	List<Map<String,Object>> getMedicalRecordScanSendData(MedicalRecordQuery medicalRecordQuery);
	
	/**
	 * 获取扫描纸质扫描病案数量
	 * @return
	 */
	int getMedicalRecordCountScanSendData(MedicalRecordQuery medicalRecordQuery);
	
	
	int insertUploadScan(UploadScan record);
	
	int insertScanFile(ScanFile record);
	
	int insertUploadScanFile(UploadScanFile record);
	
	/**
	 * 获取第三方文件上传
	 * @return
	 */
	List<Map<String,Object>> getUploadScanByQuery(UploadScanQuery query);
	
	/**
	 * 获取第三方文件上传数量
	 * @return
	 */
	int getUploadScanCountByQuery(UploadScanQuery query);
	
	List<String> getFileHashByUploadScanId(@Param("uploadScanId") Integer uploadScanId);
	
	int insertMedicalResource(MedicalResource record);
	
	int insertMedicalResourcePic(MedicalResourcePic record);
	
	int updateUploadScanRelevance(UploadScan record);
	
	List<Map<String,Object>> getMedResourceByFirstLevelGuid(@Param("firstLevelGuid") String firstLevelGuid);

	List<Map<String,Object>> getPaginationScanFilesByFirstGuidAndPagination(@Param("firstGuid")String firstGuid,@Param("paginationStatus")String paginationStatus,@Param("unPaginationStatus")String unPaginationStatus);
    
	List<Map<String,Object>> getMrPageTypeById(Integer id);
	
	List<Map<String,Object>> getMrPageTypes();
	
	List<Map<String,Object>> getMrPageTypesOfPaginationCountByFirstGuid(@Param("firstGuid")String firstGuid);
    
	int  getPaginationFileCount(@Param("firstGuid")String firstGuid,@Param("unPaginationStatus")String unPaginationStatus);
    
	MedicalResource getMedicalResourceByFirstGuidAndFileHash(@Param("fileHash") String fileHash,@Param("firstGuid") String firstGuid);
    
	int updateMedicalResourceById(MedicalResource record);
	
	List<Map<String,Object>> getMrPageTypesOfPaginationCountByFirstGuidAndMrPageId(@Param("firstGuid")String firstGuid,@Param("mrPageTypes")List<Integer> mrPageTypes);

	MedicalResourcePic getMedicalResourcePicByFirstGuidAndFileHash(@Param("firstGuid")String firstGuid,@Param("fileHash")String fileHash);
	
	int deleteMedicalResourcePicById(Integer id);
	
	int deleteMedicalResourceById(Integer id);
	
	ScanFile getScanFileByFileHash(String fileHash);
	
	int updateScanFileByFileHash(ScanFile record);
}
